#ifndef OVERLORD_H_INCLUDED
#define OVERLORD_H_INCLUDED

#include "XGE_Common.h"
#include "IManager.h"

//TODO: Make Object function more like ObjectComponent, where it must be superclassed
//TODO: Each superclass must be registered with the ObjectManager for proper creation
//TODO: Possibly create a Factory<typename T> class to be added to the ObjectManager
//TODO: With 2 specializations: class ObjectFactory : public Factory<XGE::Object>
//TODO: and class ObjectComponentFactory : public Factory<XGE::ObjectComponent>
//TODO: To where Factory<T> will perform thusly:
//TODO: XGE::Object* obj = Overlord::getSingleton()->getManager("ObjectManager")->addObject("ObjectName", ObjectManager->getObjectFactory()->createNew("ObjectName"));
//TODO: Overlord::getSingleton()->getManager("ObjectManager")->addComponent(obj, ObjectManager->getObjectComponentFactory()->createNew("ObjectComponentName"));

namespace XGE
{
    class Overlord : public Ogre::Singleton<XGE::Overlord>
    {
        protected:
            XGE::IManagerMap managers;
            XGE::IManagerVec vManagers;
            Ogre::String strName;

            Ogre::Root* root;
            Ogre::RenderWindow* window;

            bool quit;

        public:

            static Overlord& getSingleton(void);
            static Overlord* getSingletonPtr(void);

            Overlord(const Ogre::String& nAppName);
            ~Overlord();

            Ogre::RenderWindow* getWindow(void) { return window; };
            const Ogre::String& getName(void) { return strName; };

            bool init(void);
            bool addManager(IManager* nMan);
            bool getManager(Ogre::String nManName);
            void removeManager(Ogre::String nManName);
            bool execute();
    };
}

#endif // OVERLORD_H_INCLUDED
